﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;

namespace MMOEng.World
{
    public abstract class BaseLevelCollection : ILevelCollection
    {
        public static readonly float LevelBrickSize = 50.0f;
        
        protected MMOGame game;

        public Matrix View { get; set; }
        public Matrix World { get; set; }
        public Matrix Projection { get; set; }

        public BoundingBox BoundingBox { get; private set; }

        public BaseLevelCollection(MMOGame game)
        {
            this.game = game;
        }

        public void SetGridCoordinates(int x, int y)
        {
            Vector3 worldPos = new Vector3(x * LevelBrickSize, 0, y * LevelBrickSize);
            World = Matrix.CreateTranslation(worldPos);
        }

        /// <summary>
        /// Build a bounding box that encapsulates this level brick's static content
        /// </summary>
        /// <returns>A bounding box for this level brick</returns>
        protected abstract BoundingBox BuildBoundingBox();

        public abstract void Draw(GameTime gametime);
        public abstract void Update(GameTime gameTime);
        public abstract void LoadContent();
    }
}
